package com.efast.dmom.mgmt.dao.mes;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.efast.dmom.mgmt.bean.mes.TwBatchDeleteBean;

public interface TwBatchDeleteDao {
	//批量删除检测项
	void deleteCheckItem(List<TwBatchDeleteBean>list);
	//批量删除缺陷代码
	void deleteDefectCode(List<TwBatchDeleteBean>list);
	
	//批量删除检测项与缺陷代码
	void deleteCheckItemAndDefectCode(List<TwBatchDeleteBean>list);
	//批量删除工厂
	void deletePlantInfo(List<TwBatchDeleteBean>list);
	//校验工厂是否被车间引用
    int selectShopCountByPlantId(Integer plantId);
    //批量删除车间
    void deleteShopInfo(List<TwBatchDeleteBean>list);
    //校验车间是否被区域引用
    int selectAreaCountByShopId(Integer shopId);
    
    //批量删除区域
    void deleteAreaInfo(List<TwBatchDeleteBean>list);
    //校验区域是否被产线引用
    int selectLineCountByAreaId(Integer areaId);
    
    //批量删除产线
    void deleteLineInfo(List<TwBatchDeleteBean>list);
    //校验区域是否被产线引用
    int selectStationCountByLineId(Integer lineId);
    
    //批量删除工位
    void deleteStationInfo(List<TwBatchDeleteBean>list);
    //校验工位是否被生产过程定义引用
    int selectCountByStationId(Integer stationId);
    
    //删除工序
    void deleteOperationInfo(Integer operationId);
    //校验工序是否被工艺路线引用
    int selectCountByOperationId(Integer operationId);
    @Select("select shop_name as shopName, item_name as itemName, defect_code as defectCode from qm_bas_shop_defectcode")
    List<TwBatchDeleteBean> selectCheckItemAndDefectCode();
}
